#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
#include <stdlib.h>

int* twoSum(int* numbers, int numbersLen, int target, int* returnSize) {
    int* ptr = (int*)calloc(2, sizeof(int));
    for (int i = 0; i < numbersLen; i++)// write code here
    {
        if (numbers[i] > target)
            continue;
        for (int j = i + 1; j < numbersLen; j++)
        {
            int sum = numbers[i] + numbers[j];
            if (sum == target)
            {
                ptr[0] = i + 1;
                ptr[1] = j + 1;
                *returnSize = 2;
                return ptr;
            }
        }
    }
    *returnSize = 0;
    return 0;
}

int main()
{
    int arr[] = { 3,2,4 };
    int* print;
    int n = 0;
    int i = 0;
    int sz = sizeof(arr) / sizeof(arr[0]);
    print = twoSum(arr, sz, 6, &n);
    for (i = 0; i < n; i++)
    {
        printf("%d ", print[i]);
    }
    return 0;
}